<?php
declare (strict_types=1);

namespace app\common\controller;

use think\captcha\facade\Captcha;

/**=========================================
 * Copyright © 2023-2024, WICMS.CN. All Rights Reserved
 * Project Name: WiCMS
 * Description: 默认后端应用控制器基类控制器
 * Author: jason
 * Email: 52527998@QQ.COM
 * Date: 2024/9/11
 * Time: 下午4:22
 * File: app\common\controller\BaseAdmin.php
 * =========================================
 */
class BaseAdmin extends BaseCommon
{

    public function initialize(): void
    {
        parent::initialize();
    }


    /**
     * @param string $time
     *
     * @return void
     */
    public function get_captcha(string $time = ''): void
    {
        $data             = Captcha::create();
        $data['code']     = sha1(md5(strtolower($data['code']) . strtoupper($data['code'])));
        $this->returnApi('success', $data);
    }
}